#ifndef SONGMENU_H
#define SONGMENU_H

#include <QGraphicsObject>
#include "gui.h"

class KTV;
class Resource;
class QPropertyAnimation;

class SongMenu : public GUI
{
    Q_OBJECT
    Q_PROPERTY(int index READ indexForAnimation WRITE setIndexForAnimation)
public:
    SongMenu(KTV *k, int w, int h);
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    void keyPressEvent(QKeyEvent *event);

    void appear();
    void disappear();

    void nextMenu();
    void previousMenu();
    void startAnimation();

    int indexForAnimation() const { return index_for_animation; }
    void setIndexForAnimation(int index);
    // GUI
    void left() { previousMenu(); }
    void right() { nextMenu(); }
    void select();
private slots:
    void afterDisappear();

private:
    Resource *resource;
    KTV *ktv;
    int width;
    int height;
    QPixmap *backgroundPixmap;

    int currMenu;

    int index_for_animation;
    QPropertyAnimation *animation;

    QList<QPixmap *> *appearance;
    QList<QPixmap *> *option;
};

#endif // SONGMENU_H
